<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</meta>
<title>F.validator</title>
<link type="text/css" rel="stylesheet" href="../css/admin.css" />
<link type="text/css" rel="stylesheet" href="../css/item_show.css" />
<script type="text/javascript" src="../../1st.js"></script>
<script type="text/javascript" src="../../1st.highlight.js"></script>
</head>
<body id="split">
<div id="content">
	<div rel="F.param">
		<h2><span>返回值:</span>F.validator</h2>
					<h3>概述 : 表单验证</h3>
									<h3>语法1：F.validator(form, chkitemlist)</h3>
						<table class="args">
				<!--caption>参数列表：(2)</caption-->
				<tr><th>参数名称</th><th>类型</th><th>描述</th></tr>
									<tr><td><strong>form</strong></td><td>String,Node</td><td>form表单名称或form对象</td></tr>
									<tr><td><strong>chkitemlist</strong></td><td>Array</td><td> 验证项列表</td></tr>
								<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td>返回值</td><td>Boolean</td><td>验证通过返回true，否则返回false</td></tr>
			</table>
				<div class="example">
			<h3>示例 : </h3>
							<h5 xmlns="">CSS代码:</h5>
				<pre xmlns=""><code id="cssbox"></code></pre>
						
							<h5 xmlns="">HTML代码:</h5>
				<pre xmlns=""><code id="htmlbox"></code></pre>
									
				<h5 xmlns="">JS代码:</h5>
				<pre xmlns=""><code id="jsbox"></code></pre>
								</div>
		<div style="text-align:right">
			
					
				<button onclick="window.open('../codepages/118.html');">运行代码</button>
						
		</div><br/>	
		<div>
			<h3>同类参考 :</h3>
			<div>
							<span><a href='54.html'>F.diyForm</a></span>&#12288;|&#12288;							<span><a href='117.html'>F.getForm</a></span>&#12288;|&#12288;							<span><a href='116.html'>F.setForm</a></span>&#12288;|&#12288;							<span><a href='55.html'>F.radio</a></span>&#12288;|&#12288;							<span><a href='56.html'>F.checkbox</a></span>&#12288;|&#12288;							<span><a href='139.html'>F.selectall</a></span>&#12288;|&#12288;							<span><a href='58.html'>F.tipbox</a></span>&#12288;|&#12288;							<span><a href='57.html'>F.limitbox</a></span>&#12288;|&#12288;							<span><a href='140.html'>F.codebox</a></span>						</div>
		</div>
	</div>
</div><br />

<textarea id="css" style="display:none;">html, body{font-size:12px; color:#333; font-family:"Courier New", Courier, monospace;}
.tb{ border-collapse:collapse; border:1px solid #ccc; }
.tb td{ border:1px solid #ccc; }
.tb .txt{ border:1px solid #A5AEB6; padding:2px; width:196px; height:18px;}
.tb s{text-decoration:none; color:red; margin-right:5px;}
.tb i{font-style:normal; color:red; background:url(/img/error.png) no-repeat; padding-left:20px; display:none;}
.tb u{text-decoration:none;color:gray; background:url(/img/onload.gif) no-repeat; padding-left:20px; display:none;}
.tb b{font-weight:normal; color:green; background:url(/img/right.png) no-repeat; padding-left:20px; display:none;}</textarea>
<textarea id="html" style="display:none;"><form class="First_Form" action="data/validator.php?chk=form" ajax="callback">
	<table width="600" border="0" cellspacing="0" cellpadding="6" align="center" class="tb">
		<tr>
			<td width="80"><s>*</s>用户名：</td>
			<td>
				<input class="txt" type="text" name="username" />
				<i required="1">请输入用户名</i>
				<i minlen="2" maxlen="16" re="uid">用户名由2-16个英文字母、数字、下划线组成。</i>
				<u url="/fw4/data/validator.php">正在验证用户名...</u>
				<b>用户名可以注册</b>				
				<i>用户名已经存在</i>
			</td>
		</tr>
		<tr>
			<td><s>*</s>密码：</td>
			<td>
				<input class="txt" type="password" name="password" />
				<i required="1">请输入密码</i>				
				<i minlen="6" maxlen="20" pattern="^w+$">密码由6-20个英文字母、数字、下划线组成。</i>
				<b>密码格式正确</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>确认密码：</td>
			<td>
				<input class="txt" type="password" id="password2" />
				<i required="1">请再输入一次密码！</i>				
				<i pwd="password">两次输入的密码不一致</i>
				<b>两次输入的密码一致</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>邮箱：</td>
			<td>
				<input class="txt" type="text" name="email" />
				<i required="1">请输入邮箱地址</i>
				<i re="email">邮箱格式有误</i>
				<b>邮箱格式正确</b>
			</td>
		</tr>
		<tr>
			<td>手机：</td>
			<td>
				<input class="txt" type="text" name="mobile" />
				<i empty="1" re="mobile">手机格式有误</i>
				<b>手机格式正确</b>
			</td>
		</tr>
		<tr>
			<td>网站：</td>
			<td>
				<input class="txt" type="text" name="site" />
				<i empty="1" re="url">网址格式有误</i>
				<b>网址格式正确</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>性别：</td>
			<td>
				<input type="radio" name="sex" />男
				<input type="radio" name="sex" />女
				<i required="1">请选择性别</i>
				<b>通过信息验证</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>城市：</td>
			<td>
				<select name="city">
					<option>--请选择城市--</option>
					<option>深圳</option>
				</select>
				<i empty="1" re="mobile">请选择城市</i>
				<b>通过信息验证</b>
			</td>
		</tr>
		<tr>
			<td><s>*</s>购物网：</td>
			<td>
				<input type="checkbox" name="eshop" /> 有药网
				<input type="checkbox" name="eshop" /> 易保网
				<i empty="1" re="url">请选择购物网</i>
				<b>通过信息验证</b>
			</td>
		</tr>		
		<tr>
			<td></td>
			<td>
				<input type="submit" value=" 提交 " style="height:24px; width:100px" />
			</td>
		</tr>
	</table>
</form></textarea>
<textarea id="js" style="display:none;">function callback(msg){
	alert(msg);
}
F.validator(document.forms[0]);</textarea>
<textarea id="result" style="display:none;"></textarea>


<script type="text/javascript">
var css = F('css').val();
var html = F('html').val();		
var js = F('js').val();
var result = F('result').val();
css && F('cssbox').highlight(css, "css");
html && F('htmlbox').highlight(html, "html");
js && F('jsbox').highlight(js, "js");
result && F('resultbox').highlight(result,"js");
</script>

</body>
</html>